import { post } from '../http'
import store from '@/store'

// 派单
export const sendOrder = ({
  uuid,
  wdcId,
  trkDvrUuid,
  surplusGdsWeight,
  sumGdsWeight,
  trkTonnage,
  wcdDwt,
  totalGdsQuantity,
  wabCtrNo,
  wabSealNo,
  wabProBatch
}) => {
  return post('/FTKJWLHYPT/transoprt/addSendelOrderRelease', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          attUuid: uuid,
          trkDvrUuid,
          fltUuid: store.state.user.FLT_UUID_DX_H,
          attLstmodifier: store.state.user.USR_CODE_DX_H,
          modifer: store.state.user.USR_CODE_DX_H,
          wdcId,
          surplusGdsWeight,
          sumGdsWeight,
          trkTonnage,
          wcdDwt,
          totalGdsQuantity,
          wabCtrNo,
          wabSealNo,
          wabProBatch
        }
      }
    }
  })
}

// 派单
export const sendOrderList = ({ list }) => {
  return post('/FTKJWLHYPT/transoprt/addSendelOrderReleaseList', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          list
        }
      }
    }
  })
}

// 派单
export const editWayBillTrkNoSer = ({ uuid, trkId, driver, wabWeight, attUuid }) => {
  return post('/FTKJWLHYPT/transoprt/editWayBillTrkNo', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          attUuid: attUuid,
          driver: driver,
          uuid: uuid,
          trkId: trkId,
          wabWeight: wabWeight,
          fltUuid: store.state.user.FLT_UUID_DX_H,
          lastmodifier: store.state.user.USR_CODE_DX_H
        }
      }
    }
  })
}
